<template>
  <h2>后裔期初-列表</h2>
  <div>
    <el-form
      :model="form"
      label-width="auto"
      style="max-width: 1000px"
      :inline="true"
    >
      <el-button type="danger" @click="router.push('/ProgenyPeriodicAddView')">+ 新增</el-button>
      <el-button type="danger">删除</el-button>
    </el-form>
  </div>
  <br />
  <hr>
  <br>
  <el-table :data="tableData" style="width: 100%">
    <el-table-column prop="progenyPeriodicId" label="序号" width="60" />
    <el-table-column prop="progenyPeriodicNumber" label="单据号" width="70" />
    <el-table-column prop="progenyPeriodicPeriodicDate" label="期初日期" width="100" >
      <template v-slot="{row}">
        {{ row.progenyPeriodicPeriodicDate.substring(0,10) }}
      </template>
      </el-table-column>
    <el-table-column prop="auricle" label="耳号" width="100" />
    <el-table-column prop="buildingName" label="栋舍名称" width="100" />
    <el-table-column prop="columnsName" label="栏位" width="100" />
    <el-table-column prop="progenyPeriodicWeight" label="重量（公斤）" width="100" />
    <el-table-column prop="name" label="创建人" width="100" >
       张三
      </el-table-column>
    <el-table-column prop="name" label="创建时间" width="100" />
    <el-table-column prop="name" label="修改人" width="100" >
      </el-table-column>
    <el-table-column prop="date" label="修改时间" width="100" />
    <el-table-column prop="name" label="审核人" width="100" />
    <el-table-column prop="name" label="审核时间" width="100" />
    <el-table-column prop="address" label="操作"  width="200">
      <template v-slot="{row}">
        <el-button type="primary"   link>审核</el-button>
        <el-button type="primary"   link>编辑</el-button>
        <el-button type="primary"   link>删除</el-button>
      </template>
      </el-table-column>
  </el-table>
</template>

<script lang="ts" setup>
import router from '@/router';
import axios from 'axios';
import { ref,onMounted } from 'vue';
onMounted(()=>{
  GetList();
})
const tableData = ref([])
function GetList()
{
  axios.post("http://localhost:5012/api/SheepFile/ProgenyPeriodicList",{})
  .then(res=>{
    console.log(res);
    tableData.value=res.data.data
  })
}
</script>
